//
//  SupplyOfGoodsModel.m
//  有材网
//
//  Created by 肖扬 on 16/1/18.
//  Copyright © 2016年 肖扬. All rights reserved.
//

#import "SupplyOfGoodsModel.h"
#import "GoodsModel.h"
@implementation SupplyOfGoodsModel
@synthesize data,list;
-(id)init{
    self = [super init];
    if (self) {
        self.data = [NSMutableDictionary dictionary];
        self.list = [NSMutableArray array];
    }
    return self;
}
-(void)parseResponseData:(NSString *)responseString{
    [super parseResponseData:responseString];
    NSMutableDictionary *tempDic = [responseString objectFromJSONString];
    NSMutableDictionary *jsonData= [tempDic objectForKey:@"data"];
    NSMutableArray *templist = [jsonData objectForKey:@"list"];
    NSMutableDictionary *pages = [jsonData objectForKey:@"pages"];
    if (pages!=nil) {
        ModelPage *model = [[ModelPage alloc]init];
        model.total_page = [pages objectForKey:@"total_page"];
        model.current_page = [pages objectForKey:@"current_page"];
        model.page_size = [pages objectForKey:@"page_size"];
        model.total_num = [pages objectForKey:@"total_num"];
        [self.data setObject:model forKey:@"pages"];
    }
    if (templist!=nil||[templist count]!=0) {
        for (int i = 0; i <[templist count]; i++) {
            NSMutableDictionary *dic = [templist objectAtIndex:i];
            SupplyInformatio *supply = [[SupplyInformatio alloc]init];
            supply.supply_id = [dic objectForKey:@"id"];
            supply.mid = [dic objectForKey:@"mid"];
            supply.material_id = [dic objectForKey:@"material_id"];
            supply.brand_id = [dic objectForKey:@"brand_id"];
            supply.brand_other = [dic objectForKey:@"brand_other"];
            
            supply.producer_id = [dic objectForKey:@"producer_id"];
            supply.model = [dic objectForKey:@"model"];
            supply.texture = [dic objectForKey:@"texture"];
            supply.pubtime = [dic objectForKey:@"pubtime"];
            supply.unit_number = [dic objectForKey:@"unit_number"];
            
            supply.length = [dic objectForKey:@"length"];
            supply.width = [dic objectForKey:@"width"];
            supply.number = [dic objectForKey:@"number"];
            supply.city = [dic objectForKey:@"city"];
            supply.province = [dic objectForKey:@"province"];
            
            supply.image_url = [dic objectForKey:@"image_url"];
            supply.price = [dic objectForKey:@"price"];
            supply.producer_name = [dic objectForKey:@"producer_name"];
            supply.material_name = [dic objectForKey:@"material_name"];
            supply.brand_name = [dic objectForKey:@"brand_name"];
            
            supply.future = [dic objectForKey:@"future"];
            supply.veneer = [dic objectForKey:@"veneer"];
            supply.eplevel = [dic objectForKey:@"eplevel"];
            
            supply.thickness = [dic objectForKey:@"thickness"];
            supply.min_buy_number = [dic objectForKey:@"min_buy_number"];
            supply.remark = [dic objectForKey:@"remark"];
            supply.upload_log_id = [dic objectForKey:@"upload_log_id"];
            
            supply.is_sales = [dic objectForKey:@"is_sales"];
            supply.create_manager = [dic objectForKey:@"create_manager"];
            supply.audit_status = [dic objectForKey:@"audit_status"];
            supply.audit_manager = [dic objectForKey:@"audit_manager"];
            supply.audit_comment = [dic objectForKey:@"audit_comment"];
            
            supply.status = [dic objectForKey:@"status"];
            supply.mtime = [dic objectForKey:@"mtime"];
            supply.ctime = [dic objectForKey:@"ctime"];
            supply.province_name = [dic objectForKey:@"province_name"];
            supply.city_name = [dic objectForKey:@"city_name"];
            supply.pics = [dic objectForKey:@"pics"];
            [self.list addObject:supply];
        }
    }
}
-(void)dealloc{
    self.data = nil;
    self.list = nil;
}
@end

@implementation SupplyInformatio

@synthesize supply_id,mid,material_id,brand_id,brand_other;
@synthesize producer_id,future,model,eplevel,texture;
@synthesize unit_number,veneer,gram,length,width;
@synthesize thickness,number,min_buy_number,price,province;
@synthesize city,remark,is_sales,producer_name,material_name;
@synthesize brand_name,pics,province_name,city_name;
@synthesize image_url,stuff;
-(id)init{
    self = [super init];
    if (self) {
        self.pics = [NSMutableDictionary dictionary];
    }
    return self;
}
-(void)dealloc{
    self.pics = nil;
}
@end
